package architect.design.patterns.creation.factorymethod;

/**
 * 工厂方法模式
 *
 * @author guanxin
 * @date 2018/5/4 15:07
 */

public class FactoryMethodCase {

    public static void main(String[] args) {
        IComputerFactory computerFactory = new LenovoComputerFactory();

        // 使用工厂方法创建联想电脑
        IComputer computer = computerFactory.createComputer();

        computer.swithOn();
        computer.switchOff();
    }
}
